<?php
class contract extends spController
{
	function index(){
		$this->display("hr/index.html");
	}
	
   function showhtml(){
   	   //select *  from  personnel  where ContractEndDate BETWEEN  date_add(now(), interval 5 day) and curdate();
   		$personnel = spClass("personnel");
   		$keyw = (int)trim($this->spArgs('day'));
   		if($keyw == 0){
			$keyw = 30;
		}
   		$c = "ContractEndDate BETWEEN  curdate()  and date_add(now(), interval ".$keyw." day)";
		$this->results = $personnel->spPager($this->spArgs('page', 1), pageSize())->findAll($c,"Name"); 
	    $this->pager =   $personnel->spPager()->getPager();
	    $this->day=$keyw;
	    $this->num = 1;
		$this->display("tmpHR/files/hetong.html");
	}	
}